home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 3 / Cream of the Crop 3.iso / windows / krnl.zip / UPDATE.INF < prev    next >
INI File  |  1993-09-23  |  31KB  |  1,015 lines

  1. ;
  2. ; KEYED SECTIONS.  These sections are provided for files where a selection
  3. ; is made from a set of files and the chosen one is copied under a generic
  4. ; name.  This can be used to update the hal.dll, ntoskrnl.exe, ntbootdd.sys,
  5. ; ntdetect.com.
  6. ;
  7.  
  8.  
  9. [FileKeyedClasses]
  10.     Hal            = hal.dll
  11.     Ntoskrnl       = ntoskrnl.exe
  12.  
  13. [FilesKeyedSections]
  14.     FilesHal       = $(STF_HALDEST)
  15.     FilesNtoskrnl  = $(STF_WINDOWSSYSPATH)
  16.  
  17. [FilesHal]
  18.  
  19.     ; for x86
  20.  
  21.     ; hal      = 1, hal.dll      , RENAME=$(NEWFILE)
  22.     ; halast   = 1, halast.dll   , RENAME=$(NEWFILE)
  23.     ; halcbus  = 1, halcbus.dll  , RENAME=$(NEWFILE)
  24.     ; hal486c  = 1, hal486c.dll  , RENAME=$(NEWFILE)
  25.     ; halmca   = 1, halmca.dll   , RENAME=$(NEWFILE)
  26.     ; halncr   = 1, halncr.dll   , RENAME=$(NEWFILE)
  27.     ; haloli   = 1, haloli.dll   , RENAME=$(NEWFILE)
  28.     ; halsm2   = 1, halsm2.dll   , RENAME=$(NEWFILE)
  29.     ; halsp    = 1, halsp.dll    , RENAME=$(NEWFILE)
  30.     ; halwyse7 = 1, halwyse7.dll , RENAME=$(NEWFILE)
  31.  
  32.     ; for mips
  33.  
  34.     ; hal      = 1, hal.dll      , RENAME=$(NEWFILE)
  35.     ; haldti   = 1, haldti.dll   , RENAME=$(NEWFILE)
  36.     ; halduomp = 1, halduomp.dll , RENAME=$(NEWFILE)
  37.     ; halfxs   = 1, halfxs.dll   , RENAME=$(NEWFILE)
  38.     ; halacr   = 1, halacr.dll   , RENAME=$(NEWFILE)
  39.  
  40.     ; for alpha
  41.  
  42.  
  43.  
  44. [FilesNtoskrnl]
  45.  
  46.     ; for x86, mips, alpha
  47.  
  48. ;
  49. ; REGULAR SECTIONS.  These sections are provided for files where the file
  50. ; just needs to be copied to a known destination.
  51. ;
  52.  
  53. [FileSections]
  54.     FilesPrimary        = C:
  55.     FilesOsLoader       = $(STF_OSLDEST)
  56.     FilesWinnt          = $(STF_WINDOWSPATH)
  57.     FilesSystem32       = $(STF_WINDOWSSYSPATH)
  58.     FilesSystem         = $(STF_WINDOWSPATH)\system
  59.     FilesDrivers        = $(STF_WINDOWSSYSPATH)\drivers
  60.     FilesConfig         = $(STF_WINDOWSSYSPATH)\config
  61.     FilesWinspool       = $(STF_WINDOWSSYSPATH)\spool
  62.     FilesPrnDriver      = $(STF_WINDOWSSYSPATH)\spool\drivers\$(!STF_PRNPLATFORM)
  63.     FilesPrnProc        = $(STF_WINDOWSSYSPATH)\spool\prtprocs\$(!STF_PRNPLATFORM)
  64.  
  65.  
  66.  
  67. ;
  68. ; FilesPrimary only covers ntldr.  For ntbootddd, a keyed section needs to
  69. ; be created.  Also this section is relevant only for x86.
  70. ;
  71. [FilesPrimary]
  72. ;    1 = 1, file1, RENAME=$(NEWFILE)
  73. ;    2 = 1, file2, RENAME=$(NEWFILE)
  74.  
  75. ;
  76. ; FilesOsLoader only covers osloader.exe.  This is only relevant
  77. ;
  78. [FilesOsLoader]
  79. ;    1 = 1, file1, RENAME=$(NEWFILE)
  80. ;    2 = 1, file2, RENAME=$(NEWFILE)
  81.  
  82. [FilesWinnt]
  83. ;    1 = 1, file1, RENAME=$(NEWFILE)
  84. ;    2 = 1, file2, RENAME=$(NEWFILE)
  85.  
  86. [FilesSystem32]
  87. ;    1 = 1, file1, RENAME=$(NEWFILE)
  88. ;    2 = 1, file2, RENAME=$(NEWFILE)
  89. 1 = 1, KRNL386.EXE, RENAME=$(NEWFILE)
  90.  
  91. [FilesSystem]
  92. ;    1 = 1, file1, RENAME=$(NEWFILE)
  93. ;    2 = 1, file2, RENAME=$(NEWFILE)
  94.  
  95. [FilesDrivers]
  96. ;    1 = 1, file1, RENAME=$(NEWFILE)
  97. ;    2 = 1, file2, RENAME=$(NEWFILE)
  98.  
  99. [FilesConfig]
  100. ;    1 = 1, file1, RENAME=$(NEWFILE)
  101. ;    2 = 1, file2, RENAME=$(NEWFILE)
  102.  
  103. [FilesWinspool]
  104. ;    1 = 1, file1, RENAME=$(NEWFILE)
  105. ;    2 = 1, file2, RENAME=$(NEWFILE)
  106.  
  107. [FilesPrnDriver]
  108. ;    1 = 1, file1, RENAME=$(NEWFILE)
  109. ;    2 = 1, file2, RENAME=$(NEWFILE)
  110.  
  111. [FilesPrnProc]
  112. ;    1 = 1, file1, RENAME=$(NEWFILE)
  113. ;    2 = 1, file2, RENAME=$(NEWFILE)
  114.  
  115.  
  116. [ProcessorID]
  117.     ProcessorID_I386  = I386
  118.     ProcessorID_I486  = I486
  119.     ProcessorID_I586  = I586
  120.     ProcessorID_R4000 = R4000
  121.  
  122. [UiVars]
  123.     STF_PLATFORMDET    = "" ? $(!LIBHANDLE) GetPlatform
  124.     STF_CSDVER         = 2
  125.     STF_BUILDVER       = 528
  126.  
  127.     STF_PRIMARY        = "C:"
  128.     STF_NTDRIVE        = ""
  129.     STF_WINDOWSPATH    = "" ? $(!LIBHANDLE) GetWindowsNtDir
  130.     STF_WINDOWSSYSPATH = "" ? $(!LIBHANDLE) GetWindowsNtSysDir
  131.     STF_CONTROLSET     = CurrentControlSet
  132.     VolumeList         = {} ? $(!LIBHANDLE) GetHardDriveLetters
  133.     VolumeFSList       = {} ? $(!LIBHANDLE) GetHardDriveFileSystems
  134.     DisketteList       = {} ? $(!LIBHANDLE) GetFloppyDriveLetters
  135.     AnyPrimaryFiles    = NO
  136.     AnyWinntFiles      = NO
  137.  
  138. [NVRAMVars]
  139.     SystemPartition = "" ? $(!LIBHANDLE) GetNVRAMVar SYSTEMPARTITION
  140.     OsLoader        = "" ? $(!LIBHANDLE) GetNVRAMVar OSLOADER
  141.     OsLoadPartition = "" ? $(!LIBHANDLE) GetNVRAMVar OSLOADPARTITION
  142.     OsLoadFilename  = "" ? $(!LIBHANDLE) GetNVRAMVar OSLOADFILENAME
  143.  
  144. ;
  145. ; INF LOGIC
  146. ;
  147.  
  148. [Shell Commands]
  149.  
  150.     set-title "Windows NT Setup"
  151.     set-subst CR = "\r"
  152.     set-subst LF = "\n"
  153.     set STF_LANGUAGE = ENG
  154.     read-syms Strings
  155.     shell "subroutn.inf" PushBillboard STATUSDLG $(Billboard1)
  156.     set BillboardPushed = TRUE
  157.  
  158.     set !LIBHANDLE      = ""
  159.     set !PATCHLIBHANDLE = ""
  160.  
  161.     ;
  162.     ; Initialize Library support for the inf
  163.     ;
  164.  
  165.     install   LoadSetupLibrary
  166.  
  167.     ;
  168.     ; find out the essential information about the installed hardware and
  169.     ; software
  170.     ;
  171.  
  172.     read-syms ProductType
  173.     ifstr(i) $(!STF_PLATFORM) == I386
  174.         set STF_PRNPLATFORM = "w32x86"
  175.     else-ifstr(i) $(!STF_PLATFORM) == Mips
  176.         set STF_PRNPLATFORM = "w32mips"
  177.     else-ifstr(i) $(!STF_PLATFORM) == Alpha
  178.         set STF_PRNPLATFORM = "w32alpha"
  179.     endif
  180.  
  181.     read-syms UiVars
  182.     detect    UiVars
  183.  
  184.     ;
  185.     ; if the Platform is not the same as the one supported by this patch
  186.     ; diskette, inform the user and quit
  187.     ;
  188.     ifstr(i) $(STF_PLATFORM) != $(STF_PLATFORMDET)
  189.          ifstr(i) $(BillboardPushed) == TRUE
  190.              shell "subroutn.inf" PopBillboard
  191.              set BillboardPushed = FALSE
  192.          endif
  193.          shell "subroutn.inf" SetupMessage $(STF_LANGUAGE) "FATAL" $(String1)
  194.          goto patchnotdone
  195.     endif
  196.  
  197.     ;
  198.     ; Check to make sure we have admin privileges, if not print fatal error
  199.     ;
  200.  
  201.     shell "registry.inf" CheckSetupModify
  202.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  203.         ; DEBUG
  204.         ;
  205.         ;shell "subroutn.inf" SetupMessage $(STF_LANGUAGE) "STATUS" "Failed to shell CheckSetupModify"
  206.         ;
  207.         ; DEBUG END
  208.         ifstr(i) $(BillboardPushed) == TRUE
  209.             shell "subroutn.inf" PopBillboard
  210.             set BillboardPushed = FALSE
  211.         endif
  212.  
  213.         Debug-Output "shelling CheckSetupModify failed"
  214.         goto patchnotdone
  215.     else-ifstr(i) $($R0) != STATUS_SUCCESSFUL
  216.         ifstr(i) $(BillboardPushed) == TRUE
  217.             shell "subroutn.inf" PopBillboard
  218.             set BillboardPushed = FALSE
  219.         endif
  220.         shell "subroutn.inf" SetupMessage $(!STF_LANGUAGE) "FATAL" $(String4)
  221.         goto patchnotdone
  222.     endif
  223.  
  224.  
  225.     ;
  226.     ; Initialize the patch library support for the inf
  227.     ;
  228.  
  229.     install   LoadPatchLibrary
  230.  
  231.  
  232.     ;
  233.     ; Get the build and patch version for the system.  If this is more than our patch
  234.     ; version warn the user, allowing him to exit
  235.     ;
  236.  
  237.     LibraryProcedure STATUS,$(!PATCHLIBHANDLE), CheckBuildVersion $(!STF_BUILDVER)
  238.     ifstr(i) $(STATUS) == ERROR
  239.         goto patchnotdone
  240.     else-ifstr(i) $(STATUS) == NO
  241.         shell "subroutn.inf" SetupMessage $(!STF_LANGUAGE) WARNING $(String8)
  242.         ifstr(i) $($R1) == "OK"
  243.             goto skip_patchvercheck
  244.         else
  245.             goto patchnotdone
  246.         endif
  247.     endif
  248.  
  249.     shell "" GetCSDVersion
  250.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  251.         ifstr(i) $(BillboardPushed) == TRUE
  252.             shell "subroutn.inf" PopBillboard
  253.             set BillboardPushed = FALSE
  254.         endif
  255.         Debug-Output "PATCH.INF: Shelling GetCSDVersion failed"
  256.         goto patchnotdone
  257.     endif
  258.  
  259.     ifstr(i) $($R0) != "STATUS_SUCCESSFUL"
  260.         Debug-Output "PATCH.INF: GetCSDVersion failed to return a value"
  261.     else
  262.         ifint $($R1) > $(!STF_CSDVER)
  263.             ifstr(i) $(BillboardPushed) == TRUE
  264.                 shell "subroutn.inf" PopBillboard
  265.                 set BillboardPushed = FALSE
  266.             endif
  267.             shell "subroutn.inf" SetupMessage $(!STF_LANGUAGE) WARNING $(String8)
  268.             ifstr(i) $($R1) == "OK"
  269.             else
  270.                 goto patchnotdone
  271.             endif
  272.         endif
  273.     endif
  274.  
  275. skip_patchvercheck = +
  276.  
  277.     ;
  278.     ; Get the NT DRIVE
  279.     ;
  280.  
  281.     GetDriveInPath !STF_NTDRIVE $(!STF_WINDOWSSYSPATH)
  282.  
  283.     ;
  284.     ; Find the hal and osloader destination on Mips and Alpha
  285.     ;
  286.  
  287.     ifstr(i) $(!STF_PLATFORM) == I386
  288.         set STF_HALDEST = $(!STF_WINDOWSSYSPATH)
  289.         set STF_OSLDEST = C:\
  290.  
  291.     else
  292.  
  293.         read-syms NVRAMVars
  294.         detect    NVRAMVars
  295.         LibraryProcedure STATUS,$(!PATCHLIBHANDLE), GetOsLoaderDest         +
  296.                                                          $(SystemPartition) +
  297.                                                          $(OsLoader)        +
  298.                                                          $(OsLoadPartition) +
  299.                                                          $(OsLoadFilename)
  300.         ifstr(i) $(STATUS) == ERROR
  301.             goto patchnotdone
  302.         else
  303.             set STF_OSLDEST = $(STATUS)
  304.             set STF_HALDEST = $(STATUS)
  305.         endif
  306.     endif
  307.  
  308.     ;
  309.     ; Get the required information about keyed files
  310.     ;
  311.  
  312.     set KeyedClassKeys  = ^(FileKeyedClasses, 0)
  313.     set KeyedClassFiles = ^(FileKeyedClasses, 1)
  314.  
  315.     LibraryProcedure STATUS,$(!PATCHLIBHANDLE), GetFileTypes $(KeyedClassFiles)
  316.     ifstr(i) $(STATUS) == ERROR
  317.         goto patchnotdone
  318.     else-ifstr(i) $(STATUS) == SETUPLOGNOTPRESENT
  319.         shell "subroutn.inf" SetupMessage $(!STF_LANGUAGE) FATAL $(String11)
  320.         goto patchnotdone
  321.     else
  322.         ForListDo $(KeyedClassKeys)
  323.             set $($)Type = *($(STATUS), $(#))
  324.         EndForListDo
  325.     endif
  326.  
  327.     ;
  328.     ; Warn the user about the patch process..
  329.     ;
  330.  
  331.     ifstr(i) $(BillboardPushed) == TRUE
  332.         shell "subroutn.inf" PopBillboard
  333.         set BillboardPushed = FALSE
  334.     endif
  335.  
  336.     shell "" QueryOkCancel $(String9)
  337.     ifstr(i) $($R1) == "OK"
  338.     else
  339.         goto patchnotdone
  340.     endif
  341.  
  342.     shell "subroutn.inf" PushBillboard STATUSDLG $(Billboard2)
  343.     set BillboardPushed = TRUE
  344.  
  345.     ;
  346.     ; Run through the directory list adding files to the copy list
  347.     ;
  348.  
  349.     read-syms FileSections
  350.     set FileSectionsList = ^(FileSections, 0)
  351.     set MoveFileExList  = {}
  352.     set FileCopiedList  = {}
  353.     set NewFilePathList = {}
  354.  
  355.     set FileSource  = $(!STF_SRCDIR)
  356.  
  357.     ForListDo $(FileSectionsList)
  358.         set FileSection = $($)
  359.         set FileDest    = $($($))
  360.         set FileList    = ^($(FileSection), 0)
  361.         ForListDo $(FileList)
  362.             set FileKey = $($)
  363.             set File    = #($(FileSection), $(FileKey), 2)
  364.             set FileDestFullPath = $(FileDest)\$(File)
  365.  
  366.             ;
  367.             ; Check to see if file exists, if it is does not exist, it doesn't
  368.             ; need to be copied over
  369.  
  370.             LibraryProcedure STATUS,$(!LIBHANDLE),CheckFileExistance $(FileDestFullPath)
  371.             ifstr(i) $(STATUS) == YES
  372.  
  373.  
  374.                 ; DEBUG
  375.                 ;
  376.                 ;shell "subroutn.inf" SetupMessage $(STF_LANGUAGE) "STATUS" "Examining to see if file opened excl: "$(FileDestFullPath)
  377.                 ;
  378.                 ; DEBUG END
  379.  
  380.                 LibraryProcedure STATUS, $(!PATCHLIBHANDLE), IsFileOpenedExclusive $(FileDestFullPath)
  381.                 ifstr(i) $(STATUS) == ERROR
  382.                     goto patchnotdone
  383.                 else
  384.                     ifstr(i) $(STATUS) == "YES"
  385.                         LibraryProcedure NEWFILE, $(!PATCHLIBHANDLE), GenerateTemporary $(FileDest)
  386.                         ifstr(i) $(NEWFILE) == ERROR
  387.                             goto patchnotdone
  388.                         else
  389.                             set FileComp = {$(FileDest)\$(NEWFILE), $(FileDestFullPath)}
  390.  
  391.                             ; DEBUG
  392.                             ;
  393.                             ;shell "subroutn.inf" SetupMessage $(STF_LANGUAGE) "STATUS" "Adding to movefile ex list: "$(FileComp)
  394.                             ;
  395.                             ; DEBUG END
  396.  
  397.                             set MoveFileExList = >($(MoveFileExList), $(FileComp))
  398.                         endif
  399.                     else
  400.                         set NEWFILE = $(File)
  401.                     endif
  402.  
  403.                     ; DEBUG
  404.                     ;
  405.                     ;shell "subroutn.inf" SetupMessage $(STF_LANGUAGE) "STATUS" "Copying File Section: "$(FileSection)" : Key: "$(FileKey)" Source: "$(FileSource)" Dest: "$(FileDest)" rename = "$(NEWFILE)
  406.                     ;
  407.                     ; DEBUG END
  408.  
  409.                     install Install-File
  410.                     set FileCopiedList  = >($(FileCopiedList),  $(File))
  411.                     set NewFilePathList = >($(NewFilePathList), $(FileDest)\$(NEWFILE))
  412.  
  413.                     ;
  414.                     ; Check to see if the file installed was on the primary drive
  415.                     ; or the winnt drive
  416.                     ;
  417.                     GetDriveInPath DestDrive $(FileDest)
  418.                     ifstr(i) $(DestDrive) == $(!STF_NTDRIVE)
  419.                         set AnyWinntFiles = YES
  420.                     else-ifstr(i) $(DestDrive) == $(!STF_PRIMARY)
  421.                         set AnyPrimaryFiles = YES
  422.                     endif
  423.  
  424.                 endif
  425.             endif
  426.         EndForListDo
  427.     EndForListDO
  428.  
  429.     ;
  430.     ; Add the keyed sections to the copy list
  431.     ;
  432.  
  433.     read-syms FilesKeyedSections
  434.     ForListDo $(KeyedClassKeys)
  435.         set FileSection = Files$($)
  436.         set FileDest    = $($(FileSection))
  437.         set FileKey     = $($($)Type)
  438.  
  439.         set KeyedClassChoices = ^(Files$($), 0)
  440.         ifcontains(i) $(FileKey) in $(KeyedClassChoices)
  441.             set File             = #(FileKeyedClasses, $($), 1)
  442.             set FileDestFullPath = $(FileDest)\$(File)
  443.             ;
  444.             ; Check to see if file exists, if it is does not exist, it doesn't
  445.             ; need to be copied over
  446.  
  447.             LibraryProcedure STATUS,$(!LIBHANDLE),CheckFileExistance $(FileDestFullPath)
  448.             ifstr(i) $(STATUS) == YES
  449.  
  450.  
  451.                 ; DEBUG
  452.                 ;
  453.                 ;shell "subroutn.inf" SetupMessage $(STF_LANGUAGE) "STATUS" "Examining to see if file opened excl: "$(FileDestFullPath)
  454.                 ;
  455.                 ; DEBUG END
  456.  
  457.                 LibraryProcedure STATUS, $(!PATCHLIBHANDLE), IsFileOpenedExclusive $(FileDestFullPath)
  458.                 ifstr(i) $(STATUS) == ERROR
  459.                     goto patchnotdone
  460.                 else
  461.                     ifstr(i) $(STATUS) == "YES"
  462.                         LibraryProcedure NEWFILE, $(!PATCHLIBHANDLE), GenerateTemporary $(FileDest)
  463.                         ifstr(i) $(NEWFILE) == ERROR
  464.                             goto patchnotdone
  465.                         else
  466.                             set FileComp = {$(FileDest)\$(NEWFILE), $(FileDestFullPath)}
  467.  
  468.                             ; DEBUG
  469.                             ;
  470.                             ;shell "subroutn.inf" SetupMessage $(STF_LANGUAGE) "STATUS" "Adding to movefile ex list: "$(FileComp)
  471.                             ;
  472.                             ; DEBUG END
  473.  
  474.                             set MoveFileExList = >($(MoveFileExList), $(FileComp))
  475.                         endif
  476.                     else
  477.                         set NEWFILE = $(File)
  478.                     endif
  479.  
  480.                     ; DEBUG
  481.                     ;
  482.                     ;shell "subroutn.inf" SetupMessage $(STF_LANGUAGE) "STATUS" "Copying File Section: "$(FileSection)" : Key: "$(FileKey)" Source: "$(FileSource)" Dest: "$(FileDest)" rename = "$(NEWFILE)
  483.                     ;
  484.                     ; DEBUG END
  485.  
  486.                     install Install-File
  487.                     set FileCopiedList  = >($(FileCopiedList),  $(File))
  488.                     set NewFilePathList = >($(NewFilePathList), $(FileDest)\$(NEWFILE))
  489.  
  490.                     ;
  491.                     ; Check to see if the file installed was on the primary drive
  492.                     ; or the winnt drive
  493.                     ;
  494.                     GetDriveInPath DestDrive $(FileDest)
  495.                     ifstr(i) $(DestDrive) == $(!STF_NTDRIVE)
  496.                         set AnyWinntFiles = YES
  497.                     else-ifstr(i) $(DestDrive) == $(!STF_PRIMARY)
  498.                         set AnyPrimaryFiles = YES
  499.                     endif
  500.  
  501.                 endif
  502.             endif
  503.  
  504.  
  505.  
  506.         endif
  507.     EndForListDo
  508.  
  509.  
  510.     ifstr(i) $(BillboardPushed) == TRUE
  511.         shell "subroutn.inf" PopBillboard
  512.         set BillboardPushed = FALSE
  513.     endif
  514.  
  515.     ;
  516.     ; Do the copy
  517.     ;
  518.  
  519.     read-syms ProgressCopy$(!STF_LANGUAGE)
  520.     install   Install-DoCopy
  521.     ifstr(i) $(STF_INSTALL_OUTCOME) == "STF_USERQUIT"
  522.         goto patchnotdone
  523.     else-ifstr(i) $(STF_INSTALL_OUTCOME) == "STF_FAILURE"
  524.         goto patchnotdone
  525.     endif
  526.  
  527.     ;
  528.     ; set up for setacl conversion if any primary files were copied and the
  529.     ; primary drive is NTFS or if any winnt files were copied and the winnt
  530.     ; drive is NTFS
  531.     ;
  532. setaclsonfiles=+
  533.     Debug-Output "SETUP.INF: Setting up for conversion and setacl if necessary."
  534.  
  535.     set Fs_C     = *($(VolumeFSList), ~($(VolumeList), $(!STF_PRIMARY)))
  536.     set Fs_Winnt = *($(VolumeFSList), ~($(VolumeList), $(!STF_NTDRIVE)))
  537.  
  538.     shell "" SetAcls $(AnyPrimaryFiles) $(AnyWinntFiles) $(Fs_C) $(Fs_Winnt)
  539.  
  540.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  541.         Debug-Output "SETUP.INF: Shelling SetAcls failed"
  542.         goto patchnotdone
  543.     else-ifstr(i) $($R0) != STATUS_SUCCESSFUL
  544.         shell "subroutn.inf" SetupMessage $(STF_LANGUAGE) "NONFATAL" $(String5)
  545.     endif
  546.  
  547.     ;
  548.     ; Process MoveFileExList
  549.     ;
  550.  
  551.     ForListDo $(MoveFileExList)
  552.         ;
  553.         set ExistingPath = *($($), 1)
  554.         set NewPath      = *($($), 2)
  555.  
  556.         ; DEBUG
  557.         ;
  558.         ;shell "subroutn.inf" SetupMessage $(STF_LANGUAGE) "STATUS" "CopyFileOnReboot "$(ExistingPath)" to "$(NewPath)
  559.         ;
  560.         ; DEBUG END
  561.  
  562.         LibraryProcedure STATUS, $(!PATCHLIBHANDLE), CopyFileOnReboot $(ExistingPath) $(NewPath)
  563.         ifstr(i) $(STATUS) == ERROR
  564.             goto patchnotdone
  565.         endif
  566.     EndForListDo
  567.  
  568.     ;
  569.     ; BUGBUG The repair disk update is not accurate so skip doing the
  570.     ; repair stuff.
  571.     ;
  572.  
  573.     goto patchdone
  574.  
  575.     ;
  576.     ; patch the emergency repair diskette
  577.     ;
  578.     ;
  579.  
  580.     ; Make sure there is a floppy drive on the machine -- use the one with
  581.     ; the lowest drive letter (usually A:).
  582.     ;
  583.  
  584.     ifstr(i) $(DisketteList) == {}
  585.         shell "subroutn.inf" SetupMessage $(STF_LANGUAGE) NONFATAL $(String6)
  586.         goto patchdone
  587.     endif
  588.     set RepairDiskette = *($(DisketteList),1)
  589.  
  590.     ;
  591.     ; prompt for the emergency repair diskette
  592.     ;
  593.  
  594. askrepair=+
  595.     shell "" QueryOkCancel  $(String7)$(RepairDiskette)$(String10)
  596.     ifstr(i) $($R1) == "OK"
  597.     else
  598.         goto patchdone
  599.     endif
  600.  
  601.     ;
  602.     ; check for the repair.inf file.  if not found tell the user and ask repair
  603.     ; diskette again
  604.     ;
  605.  
  606.     LibraryProcedure STATUS,$(!LIBHANDLE),CheckFileExistance $(RepairDiskette)\repair.inf
  607.     ifstr(i) $(STATUS) == YES
  608.     else
  609.         goto askrepair
  610.     endif
  611.  
  612.     shell "subroutn.inf" PushBillboard STATUSDLG $(Billboard3)
  613.     set BillboardPushed = TRUE
  614.  
  615.     ;
  616.     ; change the repair.inf on the diskette to fix the checksums
  617.     ;
  618.  
  619.     LibraryProcedure STATUS, $(!PATCHLIBHANDLE), FixRepairInf $(RepairDiskette)\repair.inf $(FileCopiedList) $(NewFilePathList)
  620.     ifstr(i) $(STATUS) == ERROR
  621.         goto patchnotdone
  622.     endif
  623.  
  624. patchdone =+
  625.     ifstr(i) $(BillboardPushed) == TRUE
  626.         shell "subroutn.inf" PopBillboard
  627.         set BillboardPushed = FALSE
  628.     endif
  629.  
  630.     ;
  631.     ; store the patch version applied
  632.     ;
  633.  
  634.     shell "" CSDVersionCreate $(!STF_CSDVER)
  635.     read-syms SetupDoneDlg$(!STF_LANGUAGE)
  636.     ui start "SetupDone"
  637.     ifstr(i) $(DLGEVENT) == "CONTINUE"
  638.         ui pop 1
  639.         goto rebootend
  640.     else
  641.         ui pop 1
  642.         goto finish1
  643.     endif
  644.  
  645. patchnotdone =+
  646.     ifstr(i) $(BillboardPushed) == TRUE
  647.         shell "subroutn.inf" PopBillboard
  648.         set BillboardPushed = FALSE
  649.     endif
  650.  
  651.     shell "subroutn.inf" SetupMessage $(STF_LANGUAGE) "FATAL" $(String2)
  652.     goto finish1
  653.  
  654. finish1 =+
  655.     ;
  656.     ; Free the library support
  657.     ;
  658.  
  659.     install   FreeSetupLibrary
  660.  
  661. finish =+
  662.  
  663.     install   FreePatchLibrary
  664.     exit
  665.  
  666. rebootend =+
  667.     set Reboot = YES
  668.     install   Install-Shutdown
  669.     goto finish1
  670.     exit
  671.  
  672. ;-----------------------------------------------------------------------
  673. ;
  674. ; ROUTINE:     SetAcls
  675. ;
  676. ; DESCRIPTION: To set up registry for converting volumes and / or setting
  677. ;              acls if necessary
  678. ;
  679. ; INPUTS:      $($0): AnyPrimaryFiles
  680. ;              $($1): AnyWinntFiles
  681. ;              $($2): Fs_C
  682. ;              $($3): Fs_Winnt
  683. ;
  684. ; OUTPUTS:     $R0: STATUS: STATUS_SUCCESSFUL |
  685. ;                           STATUS_FAILED     |
  686. ;
  687. ;
  688. ;------------------------------------------------------------------------
  689.  
  690. [SetAcls]
  691.     set Status = STATUS_FAILED
  692.     set AnyPrimaryFiles = $($0)
  693.     set AnyWinntFiles   = $($1)
  694.     set Fs_C            = $($2)
  695.     set Fs_Winnt        = $($3)
  696.  
  697.     set AutoLines = {}
  698.     set SetAcl_C = NO
  699.     set SetAcl_Winnt = NO
  700.  
  701.     ifstr(i) $(SetAcl_C) == NO
  702.         ifstr(i) $(Fs_C) == NTFS
  703.             set SetAcl_C =  YES
  704.         endif
  705.     endif
  706.  
  707.     ifstr(i) $(SetAcl_Winnt) == NO
  708.         ifstr(i) $(Fs_Winnt) == NTFS
  709.             set SetAcl_Winnt =  YES
  710.         endif
  711.     endif
  712.  
  713.     ifstr(i) $(AnyPrimaryFiles) != "YES"
  714.         set SetAcl_C = NO
  715.     endif
  716.  
  717.     ifstr(i) $(AnyWinntFiles) != "YES"
  718.         set SetAcl_Winnt = NO
  719.     endif
  720.  
  721.  
  722.     ifstr(i) $(SetAcl_C) == YES
  723.         ifstr(i) $(SetAcl_Winnt) == YES
  724.             set AutoLines = >($(AutoLines), "setacl /a \DosDevices\"$(!STF_WINDOWSSYSPATH)"\winperms.txt \DosDevices\"$(!STF_NTDRIVE))
  725.         else
  726.             set AutoLines = >($(AutoLines), "setacl /c \DosDevices\"$(!STF_WINDOWSSYSPATH)"\winperms.txt")
  727.         endif
  728.     else-ifstr(i) $(SetAcl_Winnt) == YES
  729.         set AutoLines = >($(AutoLines), "setacl /w \DosDevices\"$(!STF_WINDOWSSYSPATH)"\winperms.txt \DosDevices\"$(!STF_NTDRIVE))
  730.     endif
  731.  
  732.     shell "registry.inf" AppendToBootExecute $(AutoLines)
  733.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  734.         Debug-Output "SETUP.INF: Shelling AppendToBootExecute failed"
  735.         goto finish_setacls
  736.     endif
  737.  
  738.     ifstr(i) $($R0) != "STATUS_SUCCESSFUL"
  739.         Debug-Output "SETUP.INF: AppendToBootExecute failed"
  740.         goto finish_setacls
  741.     endif
  742.  
  743.     set Status = STATUS_SUCCESSFUL
  744. finish_setacls = +
  745.     Return $(Status)
  746.  
  747.  
  748.  
  749. ;-----------------------------------------------------------------------
  750. ; INSTALL HELPERS
  751. ;-----------------------------------------------------------------------
  752.  
  753. [LoadPatchLibrary]
  754.     LoadLibrary "x" patchdll.dll !PATCHLIBHANDLE
  755.     exit
  756.  
  757. [FreePatchLibrary]
  758.     ifstr(i) $(!PATCHLIBHANDLE) != ""
  759.         FreeLibrary $(!PATCHLIBHANDLE)
  760.     endif
  761.     exit
  762.  
  763. [LoadSetupLibrary]
  764.     LoadLibrary "x" $(!STF_CWDDIR)setupdll.dll !LIBHANDLE
  765.     exit
  766.  
  767. [FreeSetupLibrary]
  768.     ifstr(i) $(!LIBHANDLE) != ""
  769.         FreeLibrary $(!LIBHANDLE)
  770.     endif
  771.     exit
  772.  
  773. [Install-File]
  774.     set STF_VITAL = ""
  775.     AddSectionKeyFileToCopyList $(FileSection) $(FileKey) $(FileSource) $(FileDest)
  776.     exit
  777.  
  778. [Install-DoCopy]
  779.     CopyFilesInCopyList
  780.     exit
  781.  
  782.  
  783. [Install-Shutdown]
  784.     ;
  785.     LibraryProcedure STATUS,$(!LIBHANDLE),ShutdownSystem $(Reboot)
  786.     exit
  787.  
  788. ;-----------------------------------------------------------------------
  789. ; REGISTRY SUBROUTINES
  790. ;-----------------------------------------------------------------------
  791.  
  792. [RegistryConstants]
  793.  
  794.     MaskAllAccess          = 33554432
  795.     NoTitle                = 0
  796.     RegLastError           = $(!REG_ERROR_SUCCESS)
  797.  
  798. ;-----------------------------------------------------------------------
  799. ; ROUTINE:      CSDVersionCreate
  800. ;
  801. ; DESCRIPTION:  Creates an entry for the WinNT software.
  802. ;
  803. ; INPUTS:       $0:  CSD Version #
  804. ;
  805. ; OUTPUTS:      $R0: Status: STATUS_SUCCESSFUL
  806. ;                            STATUS_FAILED
  807. ;
  808. ;------------------------------------------------------------------------
  809.  
  810. [CSDVersionCreate]
  811.  
  812.     set Status = STATUS_FAILED
  813.     read-syms RegistryConstants
  814.  
  815.     ;
  816.     ; Modify the software tree..
  817.  
  818.     ;
  819.     ; Form the path up to the key
  820.     ;
  821.  
  822.     set KeyPath   = { +
  823.                      {SOFTWARE,       $(NoTitle), $(MaskAllAccess)}, +
  824.                      {Microsoft,      $(NoTitle), $(MaskAllAccess)}, +
  825.                      {"Windows NT",   $(NoTitle), $(MaskAllAccess)}, +
  826.                      {CurrentVersion, $(NoTitle), $(MaskAllAccess)}  +
  827.                     }
  828.  
  829.     ;
  830.     ; Form the value info structures for the WinNT entry
  831.     ;
  832.  
  833.     set KeyValues = { +
  834.                      {CSDVersion, $(NoTitle), $(!REG_VT_DWORD), $($0) } +
  835.                     }
  836.  
  837.  
  838.     shell "registry.inf" CreateKey $(!REG_H_LOCAL) $(KeyPath) $(KeyValues)
  839.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  840.         goto endCSDVersionCreate
  841.     endif
  842.     ifstr(i) $($R0) != STATUS_SUCCESSFUL
  843.         goto endCSDVersionCreate
  844.     else
  845.         CloseRegKey $($R1)
  846.     endif
  847.  
  848.     set Status = STATUS_SUCCESSFUL
  849. endCSDVersionCreate = +
  850.     Return $(Status)
  851.  
  852.  
  853.  
  854.  
  855. ;-----------------------------------------------------------------------
  856. ; ROUTINE:      GetCSDVersion
  857. ;
  858. ; DESCRIPTION:  Reads the software entry to find out what the CSD Patch Version
  859. ;               is
  860. ;
  861. ; INPUTS:       $0:  None
  862. ;
  863. ; OUTPUTS:      $R0: Status: STATUS_SUCCESSFUL
  864. ;                            STATUS_FAILED
  865. ;
  866. ;               $R1: CSDVersion
  867. ;
  868. ;------------------------------------------------------------------------
  869.  
  870. [GetCSDVersion]
  871.  
  872.     set Status = STATUS_SUCCESSFUL
  873.     read-syms RegistryConstants
  874.     set CSDVersion = 0
  875.  
  876.     ;
  877.     ; Open the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion
  878.     ; key
  879.  
  880.     set KeyName = "Software\Microsoft\Windows NT\CurrentVersion"
  881.     OpenRegKey $(!REG_H_LOCAL) "" $(KeyName) $(!REG_KEY_READ) KeyHandle
  882.     ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  883.         Debug-Output "REGISTRY.INF: Couldn't open windows nt software key for read access"
  884.         goto end_GetCSDVersion
  885.     endif
  886.  
  887.     ;
  888.     ; read the sourcepath entry
  889.     ;
  890.  
  891.     GetRegValue $(KeyHandle) "CSDVersion" CSDVersionValue
  892.     ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  893.         CloseRegKey $(KeyHandle)
  894.         goto end_GetCSDVersion
  895.     endif
  896.  
  897.     set CSDVersion =  *($(CSDVersionValue), 4)
  898.     CloseRegKey $(KeyHandle)
  899. end_GetCSDVersion = +
  900.     Return $(Status) $(CSDVersion)
  901.  
  902. ;-----------------------------------------------------------------------
  903. ; ROUTINE:      QueryOkCancel
  904. ;
  905. ; DESCRIPTION:  This routine lets the user query OK / Cancel giving OK as
  906. ;               default
  907. ;
  908. ; INPUTS:       $0:  MessageText.
  909. ;
  910. ; OUTPUTS:      $R0: STATUS:   STATUS_SUCCESSFUL |
  911. ;                              STATUS_NOLANGUAGE
  912. ;                              STATUS_FAILED
  913. ;
  914. ;               $R1: DLGEVENT: OK | CANCEL
  915. ;
  916. ;------------------------------------------------------------------------
  917.  
  918. [QueryOkCancel]
  919.  
  920.     set DlgText = $($0)
  921.     read-syms QueryOKCancelDlg$(!STF_LANGUAGE)
  922.  
  923.     ui start "SetupMessage"
  924.     ifstr(i) $(DLGEVENT) == "OK"
  925.         set Status     = STATUS_SUCCESSFUL
  926.         set UserAction = $(DLGEVENT)
  927.  
  928.     else-ifstr(i) $(DLGEVENT) == "CANCEL"
  929.         set Status     = STATUS_SUCCESSFUL
  930.         set UserAction = $(DLGEVENT)
  931.     else
  932.         set Status     = STATUS_FAILED
  933.         set UserAction = "CANCEL"
  934.     endif
  935.     Return $(Status) $(UserAction)
  936.  
  937. [ProductType]
  938. STF_PRODUCT  = Winnt
  939. STF_PLATFORM = I386
  940.  
  941. ;
  942. ; MEDIA AND FILE DESCRIPTIONS
  943. ;
  944.  
  945. [Source Media Descriptions]
  946.     1  = "Windows NT 3.1 Update Disk #1"  , TAGFILE = disk1
  947.     2  = "Windows NT 3.1 Update Disk #2"  , TAGFILE = disk2
  948.     3  = "Windows NT 3.1 Update Disk #3"  , TAGFILE = disk3
  949.     4  = "Windows NT 3.1 Update Disk #4"  , TAGFILE = disk4
  950.     5  = "Windows NT 3.1 Update Disk #5"  , TAGFILE = disk5
  951.     6  = "Windows NT 3.1 Update Disk #6"  , TAGFILE = disk6
  952.  
  953. [Strings]
  954.     String1 = "This update disk cannot be used on this platform."
  955.     String2 = "Setup failed to update the system."
  956.     String3 = "Setup has successfully updated your system."
  957.     String4 = "You do not have permission to update the system.  Please contact your system administrator."
  958.     String5 = "Setup failed to setup your updated files for secure operation."
  959.     String6 = "No floppy disk drive was found on your computer. "+
  960.               "Setup cannot modify the Emergency Repair Disk."
  961.  
  962.     String7 =  "If you created an Emergency Repair Disk during the initial installation"+
  963.                " of Windows NT, please insert it into Drive "
  964.  
  965.     String10 = " and click OK to update the repair disk.  If you cannot locate the repair"+
  966.                " disk, select Cancel and Setup will complete the installation."
  967.  
  968.     String8 = "Setup has detected that the version of the system installed is "+
  969.               "newer than the update you are applying to it.  The update can render "+
  970.               "your system unstartable.  Press OK if you still wish to continue "+
  971.               "or press Cancel to exit Setup."
  972.  
  973.     String9 = "Setup is going to update files on your system.  If you wish to "+
  974.               "cancel the update process, please press Cancel or press OK to continue."
  975.  
  976.     String11 = "Setup couldn't find the setup.log file in your windows directory. "+
  977.                "Setup cannot proceed to update your system.  Please copy the repair.inf "+
  978.                "file from your Emergency Repair Disk to your windows directory under the "+
  979.                "name setup.log and restart the update."
  980.  
  981.     Billboard1 = "Please wait..."
  982.     Billboard2 = "Please wait while the files to be updated are determined..."
  983.     Billboard3 = "Please wait while the Emergency Repair Disk is updated..."
  984.  
  985. [ProgressCopyENG]
  986.     ProCaption   = "Windows NT Setup"
  987.     ProCancel    = "Cancel"
  988.     ProCancelMsg = "The Windows NT 3.1 files are not completely updated.  Are you sure you want "+
  989.                    "to cancel copying files?"
  990.     ProCancelCap = "Setup Message"
  991.     ProText1     = "Copying:"
  992.     ProText2     = "To:"
  993.  
  994.  
  995. [SetupDoneDlgENG]
  996.     Caption     = "Windows NT Setup"
  997.     DlgText     = "Windows NT 3.1 has been updated."$(!LF)$(!LF)+
  998.                   "Remove disks from the floppy disk drives and "+
  999.                   "choose Restart Computer to run the updated system."
  1000.     Reboot      = "&Restart Computer"
  1001.     Windows     = "E&xit to Windows NT"
  1002.     DlgType     = "Info"
  1003.     DlgTemplate = "REBOOT"
  1004.  
  1005. [QueryOKCancelDlgENG]
  1006.     STF_MB_TITLE = "Setup Message"
  1007.  
  1008.     ;no translation needed after this
  1009.  
  1010.     DlgType      = "MessageBox"
  1011.     STF_MB_TEXT  = $(DlgText)
  1012.     STF_MB_TYPE  = 2
  1013.     STF_MB_ICON  = 4
  1014.     STF_MB_DEF   = 1
  1015.